#include <SGE.h>

using namespace SGE;

bool quit = false;

//graphics
SGE_Sprite sprite;
SVector2 position;


void SGE_Initialize()
{
	sprite.Load("squirtle.jpg");
}

void SGE_Terminate()
{
	sprite.Unload();
}


bool SGE_Update(float deltaTime)
{
	const float kSpeed = 100.0f;

	//sprite movement
	if(Input_IsKeyDown(Keys::RIGHT))
	{
		position.x += kSpeed * deltaTime;
	}
	else if(Input_IsKeyDown(Keys::LEFT))
	{
		position.x -= kSpeed * deltaTime;
	}
	
	if(Input_IsKeyDown(Keys::UP))
	{
		position.y -= kSpeed * deltaTime;
	}
	else if(Input_IsKeyDown(Keys::DOWN))
	{
		position.y +=kSpeed * deltaTime;
	}

	//quit
	if(Input_IsKeyPressed(Keys::ESCAPE))
	{
		quit = true;
	}
	else
	{
		quit = false;
	}
	return quit;
}

void SGE_Render()
{
	sprite.SetPosition(position);
	sprite.Render();
}

